/*
 * bridge_arp_snat.h
 *
 *  Created on: 2011/5/23
 *      Author: 980262
 */

#ifndef BRIDGE_TCP_FILTER_H_
#define BRIDGE_TCP_FILTER_H_

#include <linux/if_ether.h>

#define TCP_FILTER_BASE_CTL            300

#define TCP_FILTER_SO_SET_ADD          (TCP_FILTER_BASE_CTL)
#define TCP_FILTER_SO_SET_DEL          (TCP_FILTER_SO_SET_ADD+1)
#define TCP_FILTER_SO_SET_ZERO         (TCP_FILTER_SO_SET_DEL+1)
#define TCP_FILTER_SO_SET_MAX          (TCP_FILTER_SO_SET_ZERO+1)

#define TCP_FILTER_SO_GET_INFO         (TCP_FILTER_BASE_CTL)
#define TCP_FILTER_SO_GET_ENTRIES      (TCP_FILTER_SO_GET_INFO+1)
#define TCP_FILTER_SO_GET_COUNTER      (TCP_FILTER_SO_GET_ENTRIES+1)
#define TCP_FILTER_SO_GET_MAX          (TCP_FILTER_SO_GET_COUNTER+1)


/* The argument to TCP_FILTER_SO_GET_INFO */
struct filter_getinfo {
    /* number of rules */
    unsigned int		num_rules;
};

struct filter_getcounter {
    unsigned int    total_count;
};

struct filter_rule_info_user { /* ADD, DEL */
    __be32 d_ip;
    __u16 d_port;
};

/* The argument to TCP_FILTER_SO_GET_ENTRIES */
struct filter_get_rules {
	/* number of rules */
	unsigned int		num_rules;

	/* rule table */
	struct filter_rule_info_user ruletable[0];
};

#endif /* BRIDGE_TCP_FILTER_H_ */
